package com.zh.boottinyhttps.config;

import org.apache.catalina.connector.Connector;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Author: zhanghuan
 * @date: 2022/10/20 21:51
 * @description: create it
 */
@Configuration
@Component
public class TomcatConfig implements WebServerFactoryCustomizer<TomcatServletWebServerFactory> {

    @Override
    public void customize(TomcatServletWebServerFactory factory) {
        final Connector connector = new Connector("HTTP/1.1");
        connector.setPort(6789);
        factory.addAdditionalTomcatConnectors(connector);
    }
}